package externalflame.systemdesign.newsfeed.entity;


import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Date;

@Data
@AllArgsConstructor
public class Tweet implements Comparable, BaseEntity {
    Long id;
    Long userId;
    String content;
    Date createdTime;


    @Override
    public int compareTo(Object o) {
        if (o instanceof Tweet) {
            return (int) (createdTime.getTime() - ((Tweet) o).createdTime.getTime());
        }
        return 0;
    }
}
